package oop多态作业;

public class Trapezoid extends Graph {
    private  int height;
    private  int left;
    private  int right;
    public Trapezoid(int length, int width, int height ,int left,int right) {
        super(length, width);
        this.height = height;
        this.left=left;
        this.right=right;
    }
    public  void area(){
        System.out.print(
                "此梯形的面积为"
        );
        System.out.print((super.getLength()+super.getWidth())*this.height+"\t");
    }
    public void perimeter(){
        System.out.print("此梯形的周长为");
        System.out.println(super.getWidth()+super.getLength()+this.right
        +this.left);
    }

}
